import 'package:flutter/material.dart';
import 'package:ws2812_time/command/config.dart';

class ESP8266 {
  static setbright(double v) {
    // Todo 发送亮度
    debugPrint("发送亮度${v.toString()}");
    Config.dio.get("http://${Config.host}/setbright?bright=$v");
    // http://192.168.31.87/setbright?bright=2
  }

  static setColor(Color color) {
    // Todo 发送颜色
    String rgb = "${color.red},${color.green},${color.blue}";
    debugPrint("发送颜色$rgb");
    Config.dio.get("http://${Config.host}/setcolor?r=${color.red}&g=${color.green}&b=${color.blue}");
  }
}
